﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace EasyPiano
{
    public partial class SetPlayingForm : Form
    {
        public SetPlayingForm()
        {
            InitializeComponent();
            cb_offset.SelectedIndex = GlobalData.offset;
            trb_volume.Value = GlobalData.volume;
            cb_continue_sound.SelectedIndex = GlobalData.continueSound ? 1 : 0;
        }

        private void bt_ok_Click(object sender, EventArgs e)
        {
            GlobalData.offset = cb_offset.SelectedIndex;
            GlobalData.volume = trb_volume.Value;
            GlobalData.continueSound = cb_continue_sound.SelectedIndex == 1 ? true : false;
            DialogResult = DialogResult.OK;
            this.Close();
        }

        private void bt_cancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}
